###################################################
README File for replications materials: 

Paper title: ''Collective victimhood beliefs and conflict-related attitudes: A meta-analysis,'' Comparative Political Studies

Authors: Marko Kljajić, Nadav Shelef, and Ethan vanderWilden
Corresponding Author: Ethan vanderWilden (ethan.vanderwilden@wisc.edu)
Date: August 7, 2025

###################################################
Overview: 

This replication folder contains all necessary components to reproduce results from above titled paper. This README file include information on:
 - Description of Software Command Files (R scripts)
 - Data and organization
 - Computing Environment
 
* When replicating the analysis, working directories may need to be changed to correctly locate data (.csv) and helper function (.R) files
* Tabular outputs appear in the R console environment, typically as Latex-ready tables
* Figure outputs appear in the 'plots' window of the R studio environment and can be saved from there (PDF dimensions [in inches] noted in comments)

###################################################
Description of Software Command Files (R Scripts):

Our main analysis (all results from the main manuscript) can be replicated with the file "mainAnalysis.R". The file begins by loading in "helper functions" (helperFunctions.R) which allow us to avoid repetition in coding. The helper function can be customized with inputs for small analysis changes (see comments in helper file function).

Results in the supplementary information file can be replicated with the script "appendixAnalysis.R". The file similarly loads the "helper functions" (helperFunctions.R) file.

The files "MainReplication.txt" and "AppendixReplication.txt" show the logs of each R script running in full, and all figures generated from those replications are saved in the folders "Figures" and "appendixFigures", respectively.


###################################################
Data and organization: 

The main analysis is done with an original dataset constructed by the authors. The file is titled "KSV_dataset.csv" and is accompanied by a codebook, explaining each column/variable (KSV_codebook.docx). 


###################################################
Computing Environment:

 - Analyses were run using R version 4.4.1
 - Analyses were primarily built with Windows version 11 (using an AMD Ryzen 5 5500U processor with a 64-bit operating system) and replicated in an R environment using MacOS version 12.6
 - Code to install and load relevant R packages are included in the "mainAnalysis.R" and "appendixAnalysis.R" files. Packages include: "tidyverse" (version 2.0.0), "patchwork" (version 1.2.0), "metafor" (version 4.6-0), "kableExtra" (version (1.4.0), "rmeta" (version 3.0), "reshape2" (version 1.4.4), and "metaSEM" (version 1.5.0).

###################################################

